package com.becca.cake.dao.users;

import java.util.List;
import java.util.Map;

import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Repository;

import com.becca.cake.model.users.UserCouponModel;
import com.becca.cake.model.users.UserFollowHolidayModel;
import com.becca.cake.model.users.UsersModel;

/**
 * 用户查询
 * @copyright  尊星(上海)信息科技有限公司
 * @author yellow
 * @date 2016年5月18日 上午11:35:45
 */
@Repository
public interface UserManagerDAO {
    /**
     *  查询所有用户
     * @param map
     * @return
     * @throws DataAccessException
     */
    List<UsersModel> selectAllUsers(Map<String, Object> map) throws DataAccessException;

    /**
     * 获取查询出的用户总数
     * @param map
     * @return
     * @throws DataAccessException
     */
    Long selectAllUsersCount(Map<String, Object> map) throws DataAccessException;

    /**
     * 添加用户信息
     * @param usersModel
     * @throws DataAccessException
     */
    void insertUser(UsersModel usersModel) throws DataAccessException;

    /**
     * 修改用户信息
     * @param usersModel
     * @throws DataAccessException
     */
    void updateUser(UsersModel usersModel) throws DataAccessException;

    /**
     * 删除用户
     * @param id
     * @throws DataAccessException
     */
    void deleteUserById(String id) throws DataAccessException;

    /**
     * 校验手机号是否已存在
     * @param mobile
     */
    String valideMobileIsExist(String mobile) throws DataAccessException;

    /**
     *  查询用户优惠券
     * @param map
     * @return
     * @throws DataAccessException
     */
    List<UserCouponModel> selectUserCouponsByMobileNo(Map<String, Object> map)
                                                                              throws DataAccessException;

    /**
     * 获取查询用户优惠券总数
     * @param map
     * @return
     * @throws DataAccessException
     */
    Long selectUserCouponsByMobileNoCount(Map<String, Object> map) throws DataAccessException;

    /**
     *  查询节日假期
     * @param map
     * @return
     * @throws DataAccessException
     */
    List<UserFollowHolidayModel> selectFollowHolidays(Map<String, Object> map)
                                                                              throws DataAccessException;

    /**
     * 获取节日假期总是
     * @param map
     * @return
     * @throws DataAccessException
     */
    Long selectFollowHolidaysCount(Map<String, Object> map) throws DataAccessException;

    /**
     * 根据id查询用户对象
     * @param userId
     * @return
     * @throws DataAccessException
     */
    UsersModel selectUserById(Integer userId) throws DataAccessException;

    /**
     * 启用/禁用
     * @param id
     * @throws DataAccessException
     */
    void updUserStatusById(Map<String, Object> map) throws DataAccessException;

    /**
     * 判断用户是否已禁用/启用
     * @param map
     * @return
     * @throws DataAccessException
     */
    Long isUserStatusExist(Map<String, Object> map) throws DataAccessException;

    /**
     * 根据手机号查询用户
     * @param selectUserByMobileNo
     * @return
     * @throws DataAccessException
     */
    UsersModel selectUserByMobileNo(String mobileNo) throws DataAccessException;

    /**
     * 统计用户 显示图表
     * @return
     * @throws DataAccessException
     */
    List<UsersModel> selectUserChart(Map<String, Object> map) throws DataAccessException;

    /**
     * 查询企业试吃用户对象
     * @param map
     * @return
     * @throws DataAccessException
     */
    Integer selectUserOfInsertOrder(Map<String, Object> map) throws DataAccessException;

    /**
     * 查询全部可用用户信息
     * @param map
     * @return
     * @throws DataAccessException
     */
    List<UsersModel> selectAllUsableUsers(Map<String, Object> map) throws DataAccessException;
    /**
     * 查询全部用户到期优惠券
     * @param map
     * @return
     * @throws DataAccessException
     */
    List<UserCouponModel> selectAllUsableUserCouponModel(Map<String, Object> map) throws DataAccessException;
}
